using System;
using System.Threading.Tasks;
using TiaoTaoHelper.Wtm.Models;


namespace HengTong.ViewModel._Admin.SysOrgVms
{
    public partial class SysOrgVm : CrudVm<SysOrg>
    {
        public SysOrgVm()
        {
            SetInclude(x => x.Parent);
        }

        protected override void InitVM()
        {
        }

        public override async Task DoAddAsync()
        {
            Entity.CreateBy = Wtm.LoginUserInfo?.ITCode;
            Entity.UpdateBy = Wtm.LoginUserInfo?.ITCode;
            Entity.CreateTime = DateTime.Now;
            Entity.UpdateTime = DateTime.Now;
            await base.DoAddAsync();
        }

        public override async Task DoEditAsync(bool updateAllFields = false)
        {
            Entity.UpdateBy = Wtm.LoginUserInfo?.ITCode;
            Entity.UpdateTime = DateTime.Now;
            await base.DoEditAsync(updateAllFields);
        }
    }
}